package fr.afcepf.atod11.framework.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import fr.afcepf.atod11.framework.controller.interfaces.IAction;
import fr.afcepf.atod11.framework.forms.LoginForm;
import fr.afcepf.atod11.framework.forms.interfaces.IActionForm;

public class ActionLogin implements IAction {

	private LoginForm actionForm;
	
	@Override
	public String execute(HttpServletRequest request,
			HttpServletResponse response) {
		PrintWriter writer;
		try {
			writer = response.getWriter();
			writer.print("Bonjour, " + actionForm.getEmail());
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		return "test";
	}

	@Override
	public IActionForm getActionForm() {
		return actionForm;
	}

	@Override
	public void setActionForm(IActionForm actionForm) {
		this.actionForm = (LoginForm) actionForm;
	}

}
